#! /usr/bin/env python
import os
from waf_dynamo import apidoc_extract_task

def configure(conf):
    pass

def build(bld):
    gameobject = bld.stlib(features = 'cxx ddf',
                           includes = '. .. ../../src ../../proto ../dmsdk',
                           source = bld.path.ant_glob('*.cpp') + bld.path.parent.parent.ant_glob('proto/gameobject/*'),
                           proto_gen_py = True,
                           protoc_includes = ['../../proto', bld.env['PREFIX'] + '/share'],
                           protopy_includes = bld.env['PREFIX'] + '/lib/python',
                           target = 'gameobject')
    bld.add_group()

    bld.recurse('test')

    apidoc_extract_task(bld, ['../../proto/gameobject/gameobject_ddf.proto', 'gameobject_script.cpp'])

    bld.install_files('${PREFIX}/include/gameobject', 'gameobject.h')
    bld.install_files('${PREFIX}/include/gameobject', 'gameobject_props.h')
    bld.install_files('${PREFIX}/include/gameobject', 'gameobject_props_lua.h')
    bld.install_files('${PREFIX}/include/gameobject', 'component.h')
    bld.install_files('${PREFIX}/include/gameobject', 'script.h')
    bld.install_files('${PREFIX}/include/gameobject', 'gameobject_script_util.h')
    bld.install_files('${PREFIX}/include/gameobject', 'res_lua.h')
    bld.install_files('${PREFIX}/share/proto/gameobject', '../../proto/gameobject/properties_ddf.proto')
    bld.install_files('${PREFIX}/share/proto/gameobject', '../../proto/gameobject/gameobject_ddf.proto')
    bld.install_files('${PREFIX}/share/proto/gameobject', '../../proto/gameobject/lua_ddf.proto')
